package com.xique.client.service.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xique.client.bean.domain.ParkIn;
import com.xique.client.bean.domain.ParkLaneCode;
import com.xique.client.bean.search.ParkLaneCodeSearch;
import com.xique.client.mapper.ParkLaneCodeMapper;
import com.xique.client.service.service.IParkLaneCodeService;
import com.xique.common.core.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author shd
 * @create 2021/11/24 13:31
 */
@Service
public class ParkLaneCodeServiceImpl implements IParkLaneCodeService {

    @Autowired
    private ParkLaneCodeMapper parkLaneCodeMapper;

    @Override
    public ParkLaneCode selectParkLaneCodeById(Long id) {
        return parkLaneCodeMapper.selectById(id);
    }

    @Override
    public ParkLaneCode selectParkLaneCode(ParkLaneCodeSearch search) {
        QueryWrapper<ParkLaneCode> wrapper = new QueryWrapper<>();
        if (null != search.getId()) {
            wrapper.eq("id", search.getId());
        }
        if (null != search.getLaneId()) {
            wrapper.eq("lane_id", search.getLaneId());
        }
        return parkLaneCodeMapper.selectOne(wrapper);
    }
}
